import sys
from tracking.player import ContourPlayer
import os
import json

try:
	data_path = sys.argv[1]
except IndexError:
	print "Usage: python play.py <datafile>"
	exit()

data = json.loads(open(data_path,'r').read())
contours = data['contours']
fa = data['parameters']['focus_area']
frame_size = (fa[3]-fa[2],fa[1]-fa[0])

player = ContourPlayer(contours,frame_size,save_frames=False)
player.play()